package lan_2021;

import java.util.Scanner;

/**
 * @Author wly
 * @Create 2023-03-26 16:12
 * @Description:https://www.lanqiao.cn/problems/2383/learning/?page=1&first_category_id=1&sort=students_count&name=%E5%8D%A1%E7%89%87
 */
public class Card2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.close();
//        1 -- (1, 1) > 1
//        2 -- (1, 1), (1, 2), (2, 2) > 1 + 2
//        3 -- (1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3) > 3 + 3
//        4 -- (1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4) > 6 + 4
        int count = 1;
        for (int i = 2; i < n; i++) {
            if (count >= n){
                System.out.println(i - 1);
                break;
            }
            count += i;
        }
    }
}
